<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
       <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
 <center>
<h3>검색결과</h3><br>
 
<table border="1">
	<tr>
		<th>보낸사람</th><th>받은사람</th><th width="180">보낸시간</th><th width="270">내용</th><th>읽음여부</th>
	</tr>
		<c:forEach items="${requestScope.resultLvo.list}" var="list">
	<tr>
	<td>${list.senderId }</td><td>${list.receiverId }</td><td width="180">${list.send_date }</td><td width="270"><a href="message.do?command=viewOneMessage&no=${list.no }">${list.content }</a></td><td>${list.didRead }</td>
	</tr>
</c:forEach>
		
</table>

<c:set var="flag" value="${requestScope.resultLvo.pagingBean.previousPageGroup }"></c:set>
<c:set var="next" value="${requestScope.resultLvo.pagingBean.nextPageGroup }"></c:set>
 

 <c:if test="${flag==true }">
 	<a href="${initParam.root }message.do?command=searchBySender&searchPage=${requestScope.resultLvo.pagingBean.startPageOfPageGroup-1 }&searchBySender=${requestScope.resultLvo.list[0].senderId}">
 	이전
 	</a>
 </c:if>
 
 
<c:forEach var="i" begin="${requestScope.resultLvo.pagingBean.startPageOfPageGroup }" end="${requestScope.resultLvo.pagingBean.endPageOfPageGroup }">
		<c:choose>
			<c:when test="${i == requestScope.resultLvo.pagingBean.nowPage }">
				${i }
			</c:when>
			<c:otherwise>
				<a href="${initParam.root }message.do?command=searchBySender&searchPage=${i }&searchBySender=${requestScope.resultLvo.list[0].senderId}">${i}</a>
			</c:otherwise>
		</c:choose>
</c:forEach>

<c:if test="${next==true}">
			<a href="${initParam.root }message.do?command=searchBySender&searchPage=${requestScope.resultLvo.pagingBean.endPageOfPageGroup+1}&searchBySender=${requestScope.resultLvo.list[0].senderId}">
			다음
			</a>
		</c:if>

</center>

